<template>
  <div class="about">
    <van-row v-for="item in shopcar" :key="item._id">
      <van-col span="2">
        <input type="checkbox" v-model="item.status" />
      </van-col>
      <van-col span="18">
        <van-card
          :num="item.num"
          :price="item.price"
          :title="item.title"
          thumb="https://img.yzcdn.cn/vant/ipad.jpeg"
        />
      </van-col>
      <van-col span="4">
        <van-stepper v-model="item.num" />
      </van-col>
    </van-row>

    <van-submit-bar
      :price="$store.getters.allPrice * 100"
      button-text="提交订单"
      @submit="onSubmit"
    >
      <!-- <van-checkbox v-model="checked">全选</van-checkbox> -->
      <van-button type="primary" @click="del">删除所选</van-button>
    </van-submit-bar>
  </div>
</template>
<script>
import { computed, reactive, ref, toRefs } from "vue";
import { useStore } from "vuex";
export default {
  setup(props) {
    const store = useStore();

    const shopcar = computed(() => {
      return store.state.shopcar;
    });

    const del = () => {
      store.commit("del");
    };
    return { shopcar, del };
  },
};
</script>
